

package com.audi.user.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;


@Entity
@Table(name = "tbl_user_loginon_count")
public class UserLoginonCount implements java.io.Serializable{
    
	private static final long serialVersionUID = 5454155825314635342L;
	
	
    /**
     * id       db_column: id 
     */ 	
	
	private Long id;
    /**
     * userId       db_column: user_id 
     */ 	
	
	private Long userId;
    /**
     * userName       db_column: user_name 
     */ 	
	//@Length(max=64)
	private java.lang.String userName;
    /**
     * createTime       db_column: create_time 
     */ 	
	
	private java.util.Date createTime;
    /**
     * ip       db_column: ip 
     */ 	
	//@Length(max=128)
	private java.lang.String ip;
    /**
     * logoutTime       db_column: logout_time 
     */ 	
	
	private java.util.Date logoutTime;
    /**
     * sessionId       db_column: session_id 
     */ 	
	//@Length(max=128)
	private java.lang.String sessionId;
	//columns END


	public UserLoginonCount(){
	}

	public UserLoginonCount(
		Long id
	){
		this.id = id;
	}

	

	public void setId(Long value) {
		this.id = value;
	}
	
	@Id 
	//@SequenceGenerator(name="USER_LOGINON_COUNT_SEQ",sequenceName="seq_USER_LOGINON_COUNT")
    //@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="USER_LOGINON_COUNT_SEQ") 
	@GenericGenerator(name="custom-id", strategy = "identity")
    @GeneratedValue(generator="custom-id")
	@Column(name = "id", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getId() {
		return this.id;
	}
	
	@Column(name = "user_id", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getUserId() {
		return this.userId;
	}
	
	public void setUserId(Long value) {
		this.userId = value;
	}
	
	@Column(name = "user_name", unique = false, nullable = true, insertable = true, updatable = true, length = 64)
	public java.lang.String getUserName() {
		return this.userName;
	}
	
	public void setUserName(java.lang.String value) {
		this.userName = value;
	}
	
	
	
	@Column(name = "create_time", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	@Column(name = "ip", unique = false, nullable = true, insertable = true, updatable = true, length = 128)
	public java.lang.String getIp() {
		return this.ip;
	}
	
	public void setIp(java.lang.String value) {
		this.ip = value;
	}
	
	
	
	@Column(name = "logout_time", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getLogoutTime() {
		return this.logoutTime;
	}
	
	public void setLogoutTime(java.util.Date value) {
		this.logoutTime = value;
	}
	
	@Column(name = "session_id", unique = false, nullable = true, insertable = true, updatable = true, length = 128)
	public java.lang.String getSessionId() {
		return this.sessionId;
	}
	
	public void setSessionId(java.lang.String value) {
		this.sessionId = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("UserId",getUserId())
			.append("UserName",getUserName())
			.append("CreateTime",getCreateTime())
			.append("Ip",getIp())
			.append("LogoutTime",getLogoutTime())
			.append("SessionId",getSessionId())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof UserLoginonCount == false) return false;
		if(this == obj) return true;
		UserLoginonCount other = (UserLoginonCount)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

